<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Class Index extends MY_Controller
{
    public function __construct()
    {
        parent::__construct();
        
        $this->data['controller'] = 'index';
        $this->load->model('Mindex');
    }
    public function index()
    {
        $this->data['action'] = 'index';
        $this->load->view('template/layout', $this->data);
    }
    
    public function createvariable(){
        $var = $this->getParamString('var');
        $data = array(
            "$var" => $this->getParamString('data'));
        $this->session->set_userdata($data);    
    }
    
    public function getvariable()
    {
        header('Content-Type: application/json; charset=utf-8');
        die($this->session->userdata($this->getParamString('var')));  
    }
}
